<template>
  <div class="wrap">
    <header>
      <span @click="go">&lt;</span>
      <h3>详情</h3>
    </header>
    <main>
      <div class="detail">
        <img :src="detail.img" alt />
        <div class="detailfont">
          <p>{{detail.title}}</p>
          <p class="p">43平/2室 1厅/远洋新天地</p>
          <span>{{detail.price}}万</span>
        </div>
      </div>

      <!-- <div class="fangyuan">
        <img src="../img/房源.png" alt="">
      </div>-->
    </main>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      detail: {}
    };
  },
  created() {
    this.getList();
  },
  methods: {
    go() {
      this.$router.go(-1);
    },
    getList() {
      axios({
        url: "/api/detail",
        method: "post",
        data: this.$route.params
      }).then(res => {
        console.log(res);
        this.detail = res.data.data;
      });
    }
  }
};
</script>

<style lang="scss">
.wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  width: 100%;
  height: 50px;
  background: rgb(72, 72, 225);
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  text-align: center;
  color: #fff;
  span {
    padding-left: 5%;
  }
  h3 {
    padding-left: 35%;
  }
}
main {
  flex: 1;
  overflow-y: scroll;
  .detail {
    img {
      width: 100%;
      height: 400px;
    }
    .detailfont {
      padding: 10px;
      p {
        font-size: 18px;
      }
      .p {
        font-size: 16px;
        color: orangered;
      }
      span {
        color: orange;
      }
    }
  }
  // .fangyuan{
  //   width: 100%;
  //   height: auto;
  //   margin-top: 15px;
  // }
}
</style>